# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CertificateManager.V1.Model.TrustStore do
  @moduledoc """
  Defines a trust store.

  ## Attributes

  *   `intermediateCas` (*type:* `list(GoogleApi.CertificateManager.V1.Model.IntermediateCA.t)`, *default:* `nil`) - Optional. Set of intermediate CA certificates used for the path building phase of chain validation. The field is currently not supported if TrustConfig is used for the workload certificate feature.
  *   `trustAnchors` (*type:* `list(GoogleApi.CertificateManager.V1.Model.TrustAnchor.t)`, *default:* `nil`) - Optional. List of Trust Anchors to be used while performing validation against a given TrustStore.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :intermediateCas =>
            list(GoogleApi.CertificateManager.V1.Model.IntermediateCA.t()) | nil,
          :trustAnchors => list(GoogleApi.CertificateManager.V1.Model.TrustAnchor.t()) | nil
        }

  field(:intermediateCas, as: GoogleApi.CertificateManager.V1.Model.IntermediateCA, type: :list)
  field(:trustAnchors, as: GoogleApi.CertificateManager.V1.Model.TrustAnchor, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.CertificateManager.V1.Model.TrustStore do
  def decode(value, options) do
    GoogleApi.CertificateManager.V1.Model.TrustStore.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CertificateManager.V1.Model.TrustStore do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
